#pragma once
#define EditBox_SetText(hWnd,pString) SendMessage(hWnd,WM_SETTEXT,0,(LPARAM)pString)

// return acturlly length
#define EditBox_GetText(hWnd,pBuf,nBufLen) SendMessage(hWnd,WM_GETTEXT,(WPARAM)nBufLen,(LPARAM)pBuf)

#define EnableWinCtrl(hWnd,bEnable) SendMessage(hWnd,WM_ENABLE,(WPARAM)bEnable,0)

#define Radio_GetStatus(hWnd) SendMessage(hWnd,BM_GETCHECK,0,0)
#define Radio_SetStatus(hWnd,bStatus) SendMessage(hWnd,BM_SETCHECK,(WPARAM)bStatus,0)

#define Check_GetStatus(hWnd) SendMessage(hWnd,BM_GETCHECK,0,0)
#define Check_SetStatus(hWnd,bStatus) SendMessage(hWnd,BM_SETCHECK,(WPARAM)bStatus,0)

#define Progress_GetPos(hWnd) SendMessage(hWnd,PBM_GETPOS,0,0)
#define Progress_SetPos(hWnd,nPos) SendMessage(hWnd,PBM_SETPOS,(WPARAM)nPos,0)
#define Progress_SetRange(hWnd,nMin,nMax) SendMessage(hWnd,PBM_SETRANGE,0,MAKELPARAM(nMin,nMax))

#define ScrollBar_GetPos(hWnd) SendMessage(hWnd,SBM_GETPOS,0,0)
#define ScrollBar_SetPos(hWnd,nPos) SendMessage(hWnd,SBM_SETPOS,(WPARAM)nPos,true)
#define ScrollBar_SetRange(hWnd,nMin,nMax) SendMessage(hWnd,SBM_SETRANGE,nMin,nMax)

#define Hotkey_SetHotKey(hWnd,bVKHotKey,bfMods) SendMessage(hWnd,HKM_SETHOTKEY,MAKEWORD(bVKHotKey, bfMods),0)
#define Hotkey_GetHotKey(hWnd) SendMessage(hWnd,HKM_GETHOTKEY,0,0)

#define Picture_SetImage(hWnd,hBitmap) SendMessage(hWnd,STM_SETIMAGE, IMAGE_BITMAP, LPARAM(hBitmap))

#define ComboBox_AddString(hWnd,pString) SendMessage(hWnd,CB_ADDSTRING, 0, (LPARAM)pString)
#define ComboBox_InsertString(hWnd,nIndex,pString) SendMessage(hWnd,CB_INSERTSTRING, (WPARAM)nIndex, (LPARAM)pString)
#define ComboBox_DeleteString(hWnd,nIndex) SendMessage(hWnd,CB_DELETESTRING, (WPARAM)nIndex, 0)
#define ComboBox_GetCount(hWnd) SendMessage(hWnd,CB_GETCOUNT, 0, 0)
#define ComboBox_GetCursel(hWnd) SendMessage(hWnd,CB_GETCURSEL, 0, 0)
#define ComboBox_GetText(hWnd,pBuf,nBufLen) SendMessage(hWnd,WM_GETTEXT,(WPARAM)nBufLen,(LPARAM)pBuf)
// return acturlly length
#define ComboBox_GetItemText(hWnd,nIndex,pBuf,nBufLen) SendMessage(hWnd,CB_GETLBTEXT,(WPARAM)nIndex,(LPARAM)pBuf)

#define ListBox_AddString(hWnd,pString) SendMessage(hWnd,LB_ADDSTRING, 0, (LPARAM)pString)
#define ListBox_InsertString(hWnd,nIndex,pString) SendMessage(hWnd,LB_INSERTSTRING, (WPARAM)nIndex, (LPARAM)pString)
#define ListBox_DeleteString(hWnd,nIndex) SendMessage(hWnd,LB_DELETESTRING, (WPARAM)nIndex, 0)
#define ListBox_GetCount(hWnd) SendMessage(hWnd,LB_GETCOUNT, 0, 0)
#define ListBox_GetCursel(hWnd) SendMessage(hWnd,LB_GETCURSEL, 0, 0)
// return acturlly length
#define ListBox_GetItemText(hWnd,nIndex,pBuf,nBufLen) SendMessage(hWnd,LB_GETTEXT,(WPARAM)nIndex,(LPARAM)pBuf)
#define ListBox_Clean(hWnd) SendMessage(hWnd,LB_RESETCONTENT,0,0)

#define Slider_SetRange(hWnd,nMin,nMax) SendMessage(hWnd,TBM_SETRANGE,true,MAKELONG(nMin,nMax))
#define Slider_GetPos(hWnd) SendMessage(hWnd,TBM_GETPOS,0,0)
#define Slider_SetPos(hWnd,nPos) SendMessage(hWnd,TBM_SETPOS,true,nPos)